<template>
    <div class="list">
        <van-nav-bar :title="$t('charge.title')" leftArrow @click-left="_return" />
        <div class="recordMain">
            <ul>
                <li v-if="list.length>0"  v-for="item in list">
                    <van-row type="flex" justify="space-between" align="center">
                        <van-col>
                            +{{Number(item.num).toFixed(2)}}  {{item.coin_name.toUpperCase()=="AAT_COIN"?"商城余额":item.coin_name.toUpperCase()}}
                        </van-col>
                        <van-col>
                            <p>{{$t('charge.title')}}</p>
                            <span>{{item.add_time}}</span>
                        </van-col>
                    </van-row>
                </li>
                <li style="color:white;text-align: center" v-if="list.length===0">暂无记录</li>
            </ul>
        </div>
    </div>
</template>

<script>
    import moment from 'moment'
    export default {
        data() {
            return {
                page:1,
                listNum:'',
                mine:{},
                price:{},
                list:{}
            }
        },
        methods: {
            _return(){
                this.$emit('_return')
            },
            getData(){
                this.$api.post('node/tradeList',{page:this.page})
                    .then(res =>{
                        this.list = res.detail.list;
                        this.listNum=res.detail.listNum
                        this.list.map(i => {
                            i.add_time = moment(i.add_time*1000).format('YYYY-MM-DD')
                        })
                    })
            }
        },
        created() {
            this.getData()
        },
        mounted() {

        },
    }
</script>

<style lang="stylus" scoped>
    [class*=van-hairline]::after{
        border: none;
    }
    .recordMain
        width 94%
        margin 0 auto
        li
            padding 10px
            margin-bottom 10px
            border-bottom 1px solid #ebebeb
            .top
                margin-top 10px
                padding-bottom 15px
                border-bottom 1px solid #404040
                .van-col
                    p
                        color #D8D8D8
                        font-size 16px
                    span
                        color #898989
                        font-size 12px
                    &:last-child
                        text-align right
                        p
                            color #CBAF89




            .bottom
                margin-top 10px
                padding-bottom 8px
                .van-col
                    p
                        color #898989
                        height 20px
                        line-height 20px
                        span
                            color #CBAF89
                    &:last-child
                        text-align right
    .list
        margin-top 10px
        li
            background bac
            padding 15px
            border-radius 5px
            margin-bottom 5px
            .van-col
                font-size 20px
                color #23ba92
                p
                    font-size 14px
                    color #f6543e
                span
                    font-size 10px
                    color #898989

</style>
